Namespace C4F.DevKit.Bluetooth.ObjectExchange

    ''' <summary>
    ''' Interface representing the data that will be required to create
    ''' an Authenticate Challenge header. This class should be inherited and
    ''' implementation should be provided for methods GenerateNonce() and
    ''' GenerateRequestDigest().
    ''' </summary>
    Public Interface IAuthenticateChallenge

#Region "Properties"

        ''' <summary>
        ''' Gets or sets the private key used by the security model.
        ''' </summary>
        Property PrivateKey() As Byte()

        ''' <summary>
        ''' Gets the Nonce value used in the security model.
        ''' </summary>
        ReadOnly Property Nonce() As Byte()

        ''' <summary>
        ''' Gets or sets a value indicating whether userId must be sent in
        ''' Authenticate Response.
        ''' Setting of this property is optional. 
        ''' </summary>
        Property RequestUserId() As Boolean

        ''' <summary>
        ''' Gets or sets a value indicating the AccessMode to be used: ReadOnly
        ''' when set, otherwise Full access is permitted.
        ''' Setting of this property is optional. 
        ''' </summary>
        Property ReadOnlyAccess() As Boolean

        ''' <summary>
        ''' Gets or sets the realm to be sent.
        ''' The realm is intended to be displayed to users so they know which
        ''' userid and password to use.
        ''' Setting of this property is optional. 
        ''' </summary>
        Property Realm() As String

#End Region

#Region "Functions/Methods"

        ''' <summary>
        ''' Method for nonce generation. This method is expected to set the
        ''' nonce value in the class after successful completion. Note that 
        ''' the nonce value should be a byte array of length 16.
        ''' </summary>
        ''' <param name="hashingParameters">Array of parameters that will be
        ''' used in by the hashing algorithm for nonce generation.</param>
        ''' <returns>Value indicating the success or failure of the operation.
        ''' </returns>
        Function GenerateNonce(ByVal ParamArray hashingParameters() As Object) As Boolean

        ''' <summary>
        ''' Method for generating request digest. Assumes that the nonce value
        ''' has been set. Note that the Reqest Digest value should be a byte 
        ''' array of length 16.
        ''' </summary>
        ''' <returns>16 byte Request Digest.</returns>
        Function GenerateRequestDigest() As Byte()

#End Region

    End Interface

End Namespace
